/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.veterinarySystem.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author 100101
 */
@Entity
@Table(name = "detalleexamen")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleExamen.findAll", query = "SELECT d FROM DetalleExamen d"),
    @NamedQuery(name = "DetalleExamen.findById", query = "SELECT d FROM DetalleExamen d WHERE d.id = :id"),
    @NamedQuery(name = "DetalleExamen.findByTipoExamen", query = "SELECT d FROM DetalleExamen d WHERE d.tipoExamen = :tipoExamen"),
    @NamedQuery(name = "DetalleExamen.findByCategoriaExamen", query = "SELECT d FROM DetalleExamen d WHERE d.categoriaExamen = :categoriaExamen"),
    @NamedQuery(name = "DetalleExamen.findByResultados", query = "SELECT d FROM DetalleExamen d WHERE d.resultados = :resultados"),
    @NamedQuery(name = "DetalleExamen.findByReceta", query = "SELECT d FROM DetalleExamen d WHERE d.receta = :receta"),
    @NamedQuery(name = "DetalleExamen.findByRecomendaciones", query = "SELECT d FROM DetalleExamen d WHERE d.recomendaciones = :recomendaciones"),
    @NamedQuery(name = "DetalleExamen.findByMedicinaPreventiva", query = "SELECT d FROM DetalleExamen d WHERE d.medicinaPreventiva = :medicinaPreventiva"),
@NamedQuery(name = "DetalleExamen.findByIdExamen", query = "SELECT d FROM DetalleExamen d WHERE d.idExamen.id = :idExamen")})
public class DetalleExamen implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "tipoExamen")
    private String tipoExamen;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "categoriaExamen")
    private String categoriaExamen;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "resultados")
    private String resultados;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "receta")
    private String receta;
    @Size(max = 200)
    @Column(name = "recomendaciones")
    private String recomendaciones;
    @Size(max = 150)
    @Column(name = "medicinaPreventiva")
    private String medicinaPreventiva;
    @JoinColumn(name = "idExamen", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Examen idExamen;

    public DetalleExamen() {
    }

    public DetalleExamen(Integer id) {
        this.id = id;
    }

    public DetalleExamen(Integer id, String tipoExamen, String categoriaExamen, String resultados, String receta, String recomendaciones, String medicinaPreventiva) {
        this.id = id;
        this.tipoExamen = tipoExamen;
        this.categoriaExamen = categoriaExamen;
        this.resultados = resultados;
        this.receta = receta;
        this.recomendaciones= recomendaciones;
        this.medicinaPreventiva=medicinaPreventiva;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTipoExamen() {
        return tipoExamen;
    }

    public void setTipoExamen(String tipoExamen) {
        this.tipoExamen = tipoExamen;
    }

    public String getCategoriaExamen() {
        return categoriaExamen;
    }

    public void setCategoriaExamen(String categoriaExamen) {
        this.categoriaExamen = categoriaExamen;
    }

    public String getResultados() {
        return resultados;
    }

    public void setResultados(String resultados) {
        this.resultados = resultados;
    }

    public String getReceta() {
        return receta;
    }

    public void setReceta(String receta) {
        this.receta = receta;
    }

    public String getRecomendaciones() {
        return recomendaciones;
    }

    public void setRecomendaciones(String recomendaciones) {
        this.recomendaciones = recomendaciones;
    }

    public String getMedicinaPreventiva() {
        return medicinaPreventiva;
    }

    public void setMedicinaPreventiva(String medicinaPreventiva) {
        this.medicinaPreventiva = medicinaPreventiva;
    }

    public Examen getIdExamen() {
        return idExamen;
    }

    public void setIdExamen(Examen idExamen) {
        this.idExamen = idExamen;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleExamen)) {
            return false;
        }
        DetalleExamen other = (DetalleExamen) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.its.dsw2.veterinarySystem.modelo.DetalleExamen[ id=" + id + " ]";
    }
    
}
